﻿#ifndef TASKIPCLIENT_H
#define TASKIPCLIENT_H

#include <QObject>
#include <QtNetWork/QTcpSocket>
#include <QtNetwork/QHostAddress>
#include "../Window/mainwindow.h"
#include "Console/myobject.h"
#include "Console/Server/SerialPort.h"
#include "agreement.h"
#include "Console/tables.h"
#include "Console/sqlbase.h"
#include "mygui.h"

//#include "globaldata.h"


class TaskIpClient : public MyObject
{
    Q_OBJECT
public:
    explicit TaskIpClient(int index,QObject *parent = nullptr);

signals:
void critical(QString );
void criticalSuccess(QString);
public slots:
    void Start();
    void Stop();
    void OnTimerJX();
    void OnTimerZY();
    void OnConnected();
    void ReadData();
    void dis();
    void disc();
    quint8 GetKw(QString Kw);
    quint8 GetTower(QString Kw);
    quint8 GetTowerB(QString Kw);
    quint8 GetComputerZ(QString Kw);
    quint8 GetComputerB(QString Kw);
    bool IsLittleEndian();
    void FreeInQuiry();
public:
    TcpRead *read;
    QTimer *timer;
    QTimer *timerConnect;
    IPData *ipdata;
    QTcpSocket *tcpSocket;
};

#endif // TASKIPCLIENT_H
